package com.daisuxia.web.service;

import java.util.HashMap;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.daisuxia.web.dao.IRepaymentDetailDao;
import com.daisuxia.web.pojo.RepaymentDetail;


@Service
public class RepaymentDetailService implements IRepaymentDetailService {

    @Autowired
    private IRepaymentDetailDao repaymentDetailDao;


    @Override
    public RepaymentDetail selectByPrimaryKey(Integer id) {
        return repaymentDetailDao.selectByPrimaryKey(id);
    }

    @Override
    public RepaymentDetail selectByOrderId(String orderId){
        return repaymentDetailDao.selectByOrderId(orderId);
    }
 

    @Override
    public boolean deleteByPrimaryKey(Integer id) {
        return repaymentDetailDao.deleteByPrimaryKey(id) > 0;
    }

    @Override
    public boolean insert(RepaymentDetail detail) {
        return repaymentDetailDao.insert(detail) > 0;
    }

    @Override
    public boolean insertSelective(RepaymentDetail detail) {
        return repaymentDetailDao.insertSelective(detail) > 0;
    }

    @Override
    public boolean updateByPrimaryKey(RepaymentDetail detail) {
        return repaymentDetailDao.updateByPrimaryKey(detail) > 0;
    }

    @Override
    public boolean updateByPrimaryKeySelective(RepaymentDetail detail) {
        return repaymentDetailDao.updateByPrimaryKeySelective(detail) > 0;
    }

	@Override
	public RepaymentDetail selectByRepaymentIdAndStatus(Integer repaymentId, Integer status) {
		 HashMap<String,Object> map=new HashMap<String,Object>();
		 map.put("repaymentId", repaymentId);
		 map.put("status", status);
		return repaymentDetailDao.selectByRepaymentIdAndStatus(map);
	}

}
